import request from '@/utils/request'

// 查询试题列表
export function listTest_paper(query) {
  return request({
    url: '/generateTest/test_paper/list',
    method: 'get',
    params: query
  })
}

// 查询试题详细
export function getTest_paper(testId) {
  return request({
    url: '/generateTest/test_paper/' + testId,
    method: 'get'
  })
}

// 新增试题
export function addTest_paper(data) {
  return request({
    url: '/generateTest/test_paper',
    method: 'post',
    data: data
  })
}

// 修改试题
export function updateTest_paper(data) {
  return request({
    url: '/generateTest/test_paper',
    method: 'put',
    data: data
  })
}

// 删除试题
export function delTest_paper(testId) {
  return request({
    url: '/generateTest/test_paper/' + testId,
    method: 'delete'
  })
}


// WordToExcel
export function WordToExcel(testId) {
  return request({
    url: '/generateTest/test_paper//word-to-excel/' + testId,
    method: 'get'
  })
}

export function download(testId) {
  return request({
    url: '/generateTest/test_paper//word-to-excel/download/' + testId,
    method: 'get',
    responseType: 'blob', // 设置响应类型为blob
    timeout:30000
  })
}

export function modify_document(modify_document_form) {
  return request({
    url: '/generateTest/test_paper/modify_document/',modify_document_form,
    method: 'post',
    data: modify_document_form,
    responseType: 'blob',
    timeout:30000
  })
}

export function modify_document_template(testId) {
  return request({
    url: '/generateTest/test_paper/modify_document_template/' + testId,
    method: 'get',
    responseType: 'blob', // 设置响应类型为blob
    timeout:30000
  })
}

